﻿@model IList<Gallery>
@using PagedList.Mvc; 
@using PagedList; 

@using MiniBottles.Models;
@{
    ViewBag.Title = @AppResource.Gallery;
    int counter = 0;
    var list = (IPagedList)ViewBag.Galleries;
}
<h5 class="title">@ViewBag.Title</h5>
<div class="greystrip"></div>
<div class="whitestrip"></div>
@if(list.PageCount > 1)
{ 
    @Html.PagedListPager(list, page => Url.Action("Gallery", "Home", new { page }) )
}
@foreach (Gallery gallery in ViewBag.Galleries)
{
   

    if (!string.IsNullOrEmpty(gallery.FileName))
    {
        counter++;
        @Html.Partial("_GalleryItem", gallery);
        if(counter%5 == 0)
        {
            <div class="clearfix"></div>
        }
    
    }

}
<div class="clearfix"></div>
@if(list.PageCount > 1)
{ 
    @Html.PagedListPager(list, page => Url.Action("Gallery", "Home", new { page }) )
}